mountoperation: Fix a crash
authorMatthias Clasen <mclasen@redhat.com>
Tue, 16 Jan 2018 19:50:25 +0000 (14:50 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 16 Jan 2018 19:50:25 +0000 (14:50 -0500)
We only create the gesture when the dialog is needed,
so don't free it unconditionally.

gtk/gtkmountoperation.c

index 4be287f629bc16534cf2ca2e3a8cafe8cc420b2f..1bd74cc26806375ca39acfc3e5edacee2002e1b4 100644 (file)
@@ -231,7 +231,8 @@ gtk_mount_operation_finalize (GObject *object)
   if (priv->handler)
     g_object_unref (priv->handler);
 
-  g_object_unref (priv->multipress_gesture);
+  if (priv->multipress_gesture)
+    g_object_unref (priv->multipress_gesture);
 
   G_OBJECT_CLASS (gtk_mount_operation_parent_class)->finalize (object);
 }